package org.example.myleet.p687;

import org.example.myleet.Utils.Assert;
import org.example.myleet.Utils.Parser;

public class Main {
    public static void main(String[] args) {
        Solution solution = new Solution();
        Assert.isTrue(4 == solution.longestUnivaluePath(Parser.parse(new Integer[]{1,null,1,1,1,1,1,1})));
        Assert.isTrue(2 == solution.longestUnivaluePath(Parser.parse(new Integer[]{5,4,5,1,1,5})));
        Assert.isTrue(2 == solution.longestUnivaluePath(Parser.parse(new Integer[]{5,4,5,1,1,null,5})));
        Assert.isTrue(2 == solution.longestUnivaluePath(Parser.parse(new Integer[]{1,4,5,4,4,5})));
        Assert.isTrue(2 == solution.longestUnivaluePath(Parser.parse(new Integer[]{1,4,5,4,4,null,5})));
        Assert.isTrue(4 == solution.longestUnivaluePath(Parser.parse(new Integer[]{1,4,5,4,4,null,5,4,4,4,4})));
        Assert.isTrue(0 == solution.longestUnivaluePath(Parser.parse(new Integer[]{})));
    }
}
